package com.hgw.Demo04_BuilderPattern.Exercises6_7_5;

/**
 * Data time:2021/12/13 10:53
 * StudentID:2019112118
 * Author:hgw
 * Description:
 */
public class Director {
    private VideoPlayerBuilder vpb=null;

    public Director(VideoPlayerBuilder vpb) {
        this.vpb = vpb;
    }

    public VideoPlayer construct() {
        if (vpb.isMenu()) {
            vpb.buildMenu();
        }
        if (vpb.isPlaylist()) {
            vpb.buildPlaylist();
        }
        vpb.buildMainWindow();
        vpb.buildControlBar();
        if (vpb.isFavoriteList()) {
            vpb.buildFavoriteList();
        }
        return vpb.createVideoPlayer();
    }
}
